package Class;

public class simulator {
    static double LatestNationalWageTaxStandard(double money) {
        double TaxReceivable = 0;
        try {
            if (0 <= money && money <= 5000) {
                TaxReceivable = 0;
            }
            if (5000 < money && money <= 8000) {
                TaxReceivable = money * 0.03;
            }
            if (8000 < money && money <= 17000) {
                TaxReceivable = money * 0.10;
            }
            if (17000 < money && money <= 30000) {
                TaxReceivable = money * 0.20;
            }
            if (30000 < money && money <= 40000) {
                TaxReceivable = money * 0.25;
            }
            if (TaxReceivable < 0) {
                System.out.println("收入有误");
            }
        } catch (Exception e) {
            System.out.println("收入有误");
        }
        final double TaxReceivable1 = TaxReceivable;
        return TaxReceivable1;
    }

    public static void SplitLine() {
        for (int i = 1; i < 45; i++) {
            System.out.print("————");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        String _18weekScoringList1[] = { "优秀", "优秀", "优秀", "及格", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀", "优秀",
                "优秀", "优秀" };
        String _18weekScoringList2[] = {  "及格", "及格", "及格", "及格", "及格", "及格", "优秀", "及格", "及格", "及格", "及格", "及格", "及格",
                "及格", "及格", "及格", "及格", "及格" };
        String _18weekScoringList3[] = {  "优秀", "及格", "及格", "及格", "优秀", "及格", "及格", "及格", "及格", "及格", "及格", "及格", "及格",
                "优秀", "及格", "及格", "及格", "及格" };
        String _18weekScoringList4[] = { "及格", "及格", "优秀", "及格", "及格", "优秀", "及格", "及格", "优秀", "及格", "及格", "及格", "及格",
                "及格", "优秀", "及格", "及格", "及格" };
        String _18weekScoringList5[] = { "及格", "优秀", "及格", "及格", "及格", "及格", "优秀", "及格", "及格", "及格", "及格", "及格", "及格",
                "及格", "及格", "及格", "及格", "不及格" };

        Lab ComputerNetworkLaboratory = new Lab(1, "计算机网络实验室", _18weekScoringList1);
        Lab CompositionPrincipleLaboratory = new Lab(2, "组成原理实验室", _18weekScoringList2);
        Lab PhysicsLaboratory = new Lab(3, "物理实验室", _18weekScoringList3);
        Lab ChemicalLaboratory = new Lab(4, "化学实验室", _18weekScoringList4);
        Lab BiologyLaboratory = new Lab(5, "生物实验会", _18weekScoringList5);
        Lab moren1[] = new Lab[5];
        Lab moren2[] = new Lab[5];
        Student ZhangSan = new Student(1, "张四", moren1, 0);
        Student LiSi = new Student(2, "李三", moren2, 0);
        ZhangSan.setlaboratory(0, moren1, ComputerNetworkLaboratory);
        ZhangSan.setlaboratory(1, moren1, CompositionPrincipleLaboratory);
        LiSi.setlaboratory(0, moren2, PhysicsLaboratory);
        LiSi.setlaboratory(1, moren2, ChemicalLaboratory);
        LiSi.setlaboratory(2, moren2, BiologyLaboratory);

        ZhangSan.WorkStudyIncome(ComputerNetworkLaboratory.getCleanlinessScore(), ZhangSan);
        ZhangSan.WorkStudyIncome(CompositionPrincipleLaboratory.getCleanlinessScore(), ZhangSan);
        LiSi.WorkStudyIncome(PhysicsLaboratory.getCleanlinessScore(), LiSi);
        LiSi.WorkStudyIncome(ChemicalLaboratory.getCleanlinessScore(), LiSi);
        LiSi.WorkStudyIncome(BiologyLaboratory.getCleanlinessScore(), LiSi);
        SplitLine();
        SplitLine();
        System.out.println("这勤工俭学模拟器可比模拟人生刺激多了");
        SplitLine();
        SplitLine();
        System.out.println("张四同学负责|" + ZhangSan.getlaboratory()[0].getLaboratoryName() + "|以及|"
                + ZhangSan.getlaboratory()[1].getLaboratoryName() + "|");
        SplitLine();
        System.out.println("|" + ZhangSan.getlaboratory()[0].getLaboratoryName() + "|18周清洁记录与卫生评比结果:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(ZhangSan.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("|" + ZhangSan.getlaboratory()[1].getLaboratoryName() + "|18周清洁记录与卫生评比结果:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(ZhangSan.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("税前收入" + ZhangSan.getmoneyEarned() + "元");
        SplitLine();
        ZhangSan.setmoney(LatestNationalWageTaxStandard(ZhangSan.getmoneyEarned()));
        System.out.println("税后收入" + ZhangSan.getmoneyEarned() + "元");
        SplitLine();
        SplitLine();
        System.out.println("李三同学负责|" + LiSi.getlaboratory()[0].getLaboratoryName() + "|、|"
                + LiSi.getlaboratory()[1].getLaboratoryName() + "|以及|" + LiSi.getlaboratory()[2].getLaboratoryName()
                + "|");
        SplitLine();
        System.out.println("|" + LiSi.getlaboratory()[0].getLaboratoryName() + "|18周清洁记录与卫生评比结果:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(LiSi.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("|" + LiSi.getlaboratory()[1].getLaboratoryName() + "|18周清洁记录与卫生评比结果:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(LiSi.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("|" + LiSi.getlaboratory()[2].getLaboratoryName() + "|18周清洁记录与卫生评比结果:");
        SplitLine();
        for (int t = 0; t < 18; t++) {
            System.out.print(LiSi.getlaboratory()[2].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine();
        System.out.println("税前收入" + LiSi.getmoneyEarned() + "元");
        SplitLine();
        LiSi.setmoney(LatestNationalWageTaxStandard(LiSi.getmoneyEarned()));
        System.out.println("税后收入" + LiSi.getmoneyEarned() + "元");
        SplitLine();
        SplitLine();
    }
}
